package com.ufaud.ais.sys.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.ufaud.ais.pub.dao.IGenericCRUDDao;
import com.ufaud.ais.pub.service.impl.GenericCRUDServiceImpl;
import com.ufaud.ais.sys.entity.Employee;
import com.ufaud.ais.sys.service.IEmployeeService;

public class EmployeeServiceImpl extends GenericCRUDServiceImpl<Employee, Long>
		implements  IEmployeeService {
	
	public EmployeeServiceImpl(IGenericCRUDDao<Employee, Long> genericDao) {
		super(genericDao);
	}

	public void createEmployee(Employee employee) {
		iGenericCRUDDao.save(employee);
	}

	public void deleteEmployeeById(Long id) {
		iGenericCRUDDao.remove(id);
	}

	public void updateEmployee(Employee employee) {
		iGenericCRUDDao.save(employee);
	}

	public List<Employee> getEmployeeAccordToDeptId(Long deptId) {
		Map<String, Object> argMap = new HashMap<String, Object>();
		argMap.put("deptId", deptId);
		return iGenericCRUDDao.findByNamedQuery("findUserByDeptId", argMap);
	}

}
